<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-31j">
<title>book</title>
<script type="text/javascript" rel="javascript" src="/javascript/jquery-1.2.5.js"></script>
<style>
    * {
        font-size:15px;
    }
    table.bodyStyle {
        text-align:center;
        border-width:3px;
        border-style:none none solid none;
        border-color:#336600;
        border-collapse:collapse;
    }
</style>
</head>
<body>
<script type="text/javascript">
    $(document).ready(function(){
         i = 0;
         $.post("/showDish",{shop:$("#shop").val()},  
         function(data){
		    $("#menu").html(data);
		 });
		 
		 $("#shop").change(function(){
            $.post("/showDish",{shop:$("#shop").val()},  
	         function(data){
	            $("#menu").html(data);
	         });
         });
                  
         $("#s_order").click(function(){
            var cboxes = [], names = [];
            cboxes = $("input[name='dishName']");            
            for(i=0;i<cboxes.length;i++) {
                if(cboxes[i].checked) {
                    names.push(cboxes[i].value);
                }                
            }            
            $.post("/orderDish",{dishName:names},  
             function(data){
                $("#result").html(data);
             });
            
         });
         
         $("#reflesh").click(function(){
            $.post("/orderDish",  
             function(data){
                windows.location.href='/';
             });
            
         });
    });
    
     
</script>
hi,{{ username }}
<br>
<form id="f_shop_select" method="post">
    please select shop :<select id='shop' name="shop">
    {% for shop in shops %}
        {{shop.id}}
        <option value="{{shop.id}}">{{shop.name}}</option>
    {% endfor %}    
    </select>
    <br>    
</form>

<form id="f_order" action="/orderDish" method="post">
    <div id="menu">
    </div>
    <input id="s_order" type="button" value="comfirm"/>
</form>

<div id="result">
    {{daliyReport}}
</div>
</body>
</html>